<?php

namespace App\Http\Controllers\admin\lak;

use App\Http\Controllers\Controller;
use App\Models\lak\FindHouse;
use App\Utils\Logic\lak\FindHouseLogic;
use Illuminate\Http\Request;
use App\Common\Responses;
use App\Utils\Lib\Redis;
class LookHouse extends Controller
{
    /*
     * 找房发布
     * @name lak
     * */
    public function FindHousePublish(Request $request){
        try {
            $data = $request->post();
            $request->validate([
                'intention' => 'required',
                'name' => 'required',
                'phone' => 'required',
            ]);
            $find_house = FindHouseLogic::findHouse($data);
            return Responses::success($find_house,200,'成功');
        }catch (\Exception $exception){
            return Responses::error([],2001,'失败');
        }
    }

    /*
    * 找房列表
    * @name lak
    * */
    public function FindHouseList(){
        try {
            $house_list = FindHouse::FindPaginate();
            return Responses::success($house_list,200,'成功');
        }catch (\Exception $exception){
            return Responses::error([],2001,'失败');
        }
    }



}
